define(function(require,exports){
    var $ = require('jquery');
    var agent = navigator.userAgent.toLowerCase();
    var nc = require('pc/normolControler');
    var quickLoginSecond = require('quickLoginSecond');
    if (!(agent.indexOf("msie") > 0)) {
        var cropboxModul = require("pc/json2");
    }
    var obj = {
        //动态获取社招域名前缀
        /*getPrefix : function(){
         var arr = ['http://img01.chrstatic.com/' , 'http://img02.chrstatic.com/' , 'http://img03.chrstatic.com/' , 'http://img04.chrstatic.com/' , 'http://img05.chrstatic.com/']
         var num = Math.round(Math.random()*4);
         return arr[num];
         },
         //动态获取pc img域名前缀
         getImgPrefix : function(){
         var arr = ['http://web01.chrstatic.com/' , 'http://web02.chrstatic.com/' , 'http://web03.chrstatic.com/' , 'http://web04.chrstatic.com/' , 'http://web05.chrstatic.com/']
         var num = Math.round(Math.random()*4);
         return arr[num];
         },*/
        getPrefix : function(){
            var arr = ['http://img01.chrstatic.com/' , 'http://img02.chrstatic.com/']
            var num = Math.round(Math.random());
            return arr[num];
        },
        //动态获取pc img域名前缀
        getImgPrefix : function(){
            var arr = ['http://web01.chrstatic.com/' , 'http://web02.chrstatic.com/']
            var num = Math.round(Math.random());
            return arr[num];
        },
        index : 0,
        initBanner : function(url){
            $.ajax({
                type : "get",
                url : url,
                dataType : "jsonp",
                success : function(data){
                    var json = eval('('+JSON.stringify(data)+')');
                    var result = json.data;
                    var fullHtml = "<ul class='full-pic-list'>";
                    var thumbHtml = "<ul class='thumb-pic'>";
                    //5个li
                    $.each(result , function(index , item){
                        if(index==6){
                            return false;
                        }
                        fullHtml += "<li><a href='"+item.jumpUrl+"' target='_blank'><img src='"+obj.getPrefix()+item.imgUrl+"' /></a></li>";
                        thumbHtml += "<li><img src='"+obj.getPrefix()+item.logUrl+"' /><p class='megnc'><span class='shadow'></span><span class='word'>"+item.logTag+"</span></p></li>"
                    });
                    fullHtml +="</ul>";
                    thumbHtml +="</ul>";
                    $(".full-pic").append(fullHtml);
                    $(".maodian").append(thumbHtml);
                    var carousel = new Carousel({
                        advertBox : $('.full-pic'),
                        anchor : $('.thumb-pic li'),
                        active : 'active',
                        box : $('.scroll'),
                        move :'vertical',
                        ran : true
                    });
                    carousel.action();
                    if(++obj.index==3){
                        main.init();
                    }
                },error:function(){
                    location.href = "http://campus.chinahr.com/Error";
                }
            });
        },
        initGoodCompany : function(url){
            $.ajax({
                type : "get",
                url : url,
                dataType : "jsonp",
                success : function(data){
                    var json = eval('('+JSON.stringify(data)+')');
                    var result = json.data;
                    var html = "<ul class='goodCompany'><li class='li'><ul>";
                    $.each(result , function(index , item){
                        if(index==16){
                            return false;
                        }
                        if(index!=0 && index%8==0){
                            html += "</ul></li><li class='li'><ul>"
                        }
                        html += "<li>";
                        html += "<a href='"+item.jumpUrl+"' target='_blank'>"
                        html += "<p class='company-wrap'>";
                        html += "<img data-original='"+obj.getPrefix()+item.imgUrl+"' />"
                        html += "<span class='cover'><span class='cover-bg'></span><span class='cover-text'>"+item.comBrief+"</span><span class='cover-arrow'></span></span>";
                        html += "</p></a>";
                        html += "<p class='company-text'><span>"+item.slogan+"</span></p>";
                        html += "</li>"
                    });
                    html += "</ul></li></ul>"
                    $(".companyAnimation").append(html);
                    var carousel2 = new Carousel({
                        advertBox : $('.companyAnimation'),
                        advertUl : 'goodCompany',
                        advertLi : 'li',
                        anchor : $('.tab-btn li'),
                        active : 'active',
                        box : $('.wrap'),
                        ran : false
                    });
                    carousel2.action();
                    //设置动画
                    function testAnim(obj,x,fn) {
                        obj.removeClass(x).addClass(x).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
                            $(this).removeClass(x);
                            fn && fn();
                        });
                    };
                    var timmer;
                    $('.wrap .goodCompany .li li').each(function(index, element) {
                        var that = $(this);
                        that.off('mouseenter').on('mouseenter',function(){
                            that.find('.cover').show();
                            testAnim(that.find('.cover'),'flipInY');
                        });
                        that.off('mouseleave').on('mouseleave',function(){
                            that.find('.cover').fadeOut();
                        })
                    });
                    if(++obj.index==3){
                        main.init();
                    }
                },error:function(){
                    location.href = "http://campus.chinahr.com/Error";
                }
            });
        },
        initHotCompany : function(url){
            $.ajax({
                type : "get",
                url : url,
                dataType : "jsonp",
                success : function(data){
                    var json = eval('('+JSON.stringify(data)+')');
                    var result = json.data;
                    var html = "<ul class='all-hot'><li class='item'><ul>";
                    var dotHtml = "<ul class='dot-ls'>"
                    dotHtml += "<li><a href='javascript:;'></a></li>"
                    $.each(result , function(index , item){
                        if(index!=0 && index%16==0){
                            html += "</ul></li><li class='item'><ul>";
                            dotHtml += "<li><a href='javascript:;'></a></li>"
                        }
                        html += "<li>";
                        html += "<a href='"+item.jumpUrl+"' target='_blank'>";
                        html += "<p class='hot-pic'>";
                        html += "<img data-original='"+obj.getPrefix()+item.imgUrl+"'/><span class='hot-hang'>"+item.comSimple+"</span>";
                        html += "</p></a></li>";
                    });
                    html += "</ul></li></ul>";
                    dotHtml += "</ul>"
                    $(".hot").append(html);
                    $(".dot").append(dotHtml);
                    if(result.length<=16){
                        $("#hotLeft").hide();
                        $("#hotRight").hide();
                        $(".dot").hide();
                    }
                    var carousel3 = new Carousel({
                        advertBox : $('.hot-wrap .hot'),
                        advertUl : 'all-hot',
                        advertLi : 'item',
                        anchor : $('.dot .dot-ls li'),
                        active : 'active',
                        box : $('.hot-wrap'),
                        prevBtn:$('#hotLeft'),
                        nextBtn:$('#hotRight'),
                        ran : false
                    });
                    carousel3.action();
                    var indexHover;
                    $('.hot-wrap .item li').each(function(index, element) {
                        $(this).off('mouseenter').on('mouseenter',function(){
                            clearTimeout(indexHover);
                            var that = $(this);
                            var h = that.offset().top;
                            var w = that.offset().left;
                            indexHover = setTimeout(function(){
                                that.addClass('hover').removeClass('nover').siblings('li').removeClass('hover').addClass('nover');
                                that.find('.hot-hang').fadeIn();
                                that.find('.hot-pic img').animate({'margin-top':'-10px'});
                            },100);

                            that.off('mouseleave').on('mouseleave',function(){
                                clearTimeout(indexHover);
                                //var that = $(this);
                                that.addClass('nover').removeClass('hover').siblings('li').removeClass('hover').addClass('nover');
                                that.find('.hot-hang').hide();
                                that.find('.hot-pic img').animate({'margin-top':'0px'});
                            });
                        });
                    });
                    if(++obj.index==3){
                        main.init();
                    }
                },
                error:function(){
                    location.href = "http://campus.chinahr.com/Error";
                }
            });
        },

        initOffer : function(url){
            $.ajax({
                type : "get",
                url : url,
                dataType : "jsonp",
                success : function(data){
                    var json = eval('('+JSON.stringify(data)+')');
                    var result = json.data;
                    var html = "<ul>";
                    $.each(result , function(index , item){
                        if(index==0){
                            html += "<li class='offer-box1'><ul>";
                        }
                        if(index==5){
                            html += "</ul><img src='"+obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/trianglewhite.png' class='offer-triangle-img'></li><li class='offer-box2'><ul>";
                        }
                        if(index==10){
                            html += "</ul><img src='"+obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/trianglegreen.png' class='offer-triangle-img'></li><li class='offer-box3'><ul>";
                        }
                        html += "<li><a href='"+item.jumpUrl+"' target='_blank'>"+item.comSimple+"</a></li>"
                        if(index==14){
                            return false;
                        }
                    })
                    html += "</ul><img src='"+obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/triangleorange.png' class='offer-triangle-img'></li></ul>";
                    $(".offer-wrap").append(html);
                },
                error:function(){
                    location.href = "http://campus.chinahr.com/Error";
                }
            });
        },

        list :[
            {"url" : "http://atc.chinahr.com/atc/getCampusIndexFocus" , "callback" : "obj.initBanner"},
            {"url" : "http://atc.chinahr.com/atc/getCampusIndexFamous" , "callback" : "obj.initGoodCompany"},
            {"url" : "http://atc.chinahr.com/atc/getCampusIndexHot" , "callback" : "obj.initHotCompany"},
            {"url" : "http://atc.chinahr.com/atc/getCampusIndexText" , "callback" : "obj.initOffer"}
        ]
        /*list :[
         {"url" : "http://10.0.2.154:1802/ad/getCampusIndexFocus" , "callback" : "obj.initBanner"},
         　{"url" : "http://10.0.2.154:1802/ad/getCampusIndexFamous" , "callback" : "obj.initGoodCompany"},
         　{"url" : "http://10.0.2.154:1802/ad/getCampusIndexHot" , "callback" : "obj.initHotCompany"},
         　{"url" : "http://10.0.2.154:1802/ad/getCampusIndexText" , "callback" : "obj.initOffer"}
         ]*/

    }
    /*
     轮播广告内容盒子    advertBox
     轮播广告内容盒子ul    advertUl
     轮播广告内容盒子Li    advertLi
     盒子内部的节点是    ul  li
     向左点击按钮		leftArrow
     向右点击按钮		rightArrow
     底部btn				anchor
     选中状态的class     active
     默认iNow			iNow
     move  运动方式  vertical level
     time 间隔时间
     整个轮播的父级盒子   BOX
     */
    function Carousel(json){
        this.box = json.box;
        this.advertBox = json.advertBox;
        this.prevBtn = json.prevBtn;
        this.nextBtn = json.nextBtn;
        this.anchor = json.anchor;
        this.active = json.active;
        this.move = json.move || 'level';
        this.time = json.time || '6000';
        this.timmer = null;
        // console.log(json.advertUl)
        if(json.advertUl){
            this.advUl = this.advertBox.find('.'+json.advertUl);
            this.advLi = this.advertBox.find('.'+json.advertLi);
            // console.log(this.advLi.length)
        }else{
            this.advUl = this.advertBox.find("ul");
            this.advLi = this.advertBox.find("li");
        }


        var oLi = this.advLi.eq(0).clone(true);;
        this.advUl.append(oLi);

        if(json.advertLi){
            this.advLi = this.advertBox.find('.'+json.advertLi);
        }else{
            this.advLi = this.advertBox.find("li");
        }

        this.width = this.advLi.eq(0).width();
        this.height = this.advLi.eq(0).height();
        this.advLength = this.advLi.length;
        this.adWidthAll = this.width * this.advLength;
        this.adHeightAll = this.height * this.advLength;
        // console.log(this.advLength)
        this.ran = json.ran || false;
        var ran = parseInt(Math.random()*this.advLength);
        if(this.ran){
            this.iNow = ran;
        }else{
            this.iNow = -1;
        }
    }
    Carousel.prototype.moveT = function(){
        var that = this;
        if(that.iNow >  that.advLength-1){
            that.iNow=0;
            if(that.move == 'level'){
                that.advUl.css('left', '0px');
            }else if(that.move == 'vertical'){
                that.advUl.css('top', '0px');
            }
            clearInterval(that.timmer);
            Carousel.prototype.move.call(that);
            that.timmer = setInterval(function(){
                Carousel.prototype.move.call(that);
            },this.time);
            return false;
        }
    }
    Carousel.prototype.move = function(){
        var that = this;
        that.iNow ++ ;
        if(that.iNow == that.advLength-1){
            that.anchor.eq(0).addClass(that.active).siblings().removeClass(that.active);
        }else{
            that.anchor.eq(that.iNow).addClass(that.active).siblings().removeClass(that.active);
        }
        Carousel.prototype.moveT.call(that);
        if(that.move == 'level'){
            that.advUl.animate({left:(- that.width * that.iNow) + 'px'},100);
        }else if(that.move == 'vertical'){
            that.advUl.animate({top:(- that.height * that.iNow) + 'px'},100);
        }
    }
    Carousel.prototype.moveAction = function(){
        var that = this;
        clearInterval(that.timmer);
        if(that.move == 'level'){
            that.advUl.css({
                width:that.adWidthAll+'px'
            });
        }else if(that.move == 'vertical'){
            that.advUl.css({
                height:that.adHeightAll+'px'
            });
        }
        that.timmer = setInterval(function(){
            Carousel.prototype.move.call(that);
        },this.time);

    }
    Carousel.prototype.mover = function(){
        var that = this;
        that.box.off('mouseenter').on('mouseenter',function(){
            clearInterval(that.timmer);
        });
        that.box.off('mouseleave').on('mouseleave',function(){
            Carousel.prototype.moveAction.call(that)
        });
    }
    Carousel.prototype.btnMove = function(){
        var that = this;
        clearInterval(that.timmer);
        that.anchor.eq(that.iNow).addClass(that.active).siblings().removeClass(that.active);
        if(that.move == 'level'){
            that.advUl.css('left', -that.iNow*that.width + 'px');
        }else if(that.move == 'vertical'){
            that.advUl.css('top',-that.iNow*that.height + 'px');
        }
    }
    Carousel.prototype.anchorBtn = function(){
        var that = this;
        that.anchor.each(function(i,e){
            $(this).off('click').on('click',function(){
                that.iNow=i;
                Carousel.prototype.btnMove.call(that);
            });
        });
    }
    Carousel.prototype.nextBtn = function(){
        var that = this;
        that.nextBtn.off('click').on('click',function(){
            that.iNow++;
            if(that.iNow >  that.advLength-2){
                that.iNow=0;
            }
            Carousel.prototype.btnMove.call(that);
        });
    }
    Carousel.prototype.prevBtn = function(){
        var that = this;
        that.prevBtn.off('click').on('click',function(){
            that.iNow--;
            if(that.iNow < 0){
                that.iNow=that.advLength-2;
            }
            Carousel.prototype.btnMove.call(that);
        });
    }
    Carousel.prototype.action = function(){
        var that = this;
        Carousel.prototype.move.call(that);
        Carousel.prototype.moveAction.call(that);
        Carousel.prototype.anchorBtn.call(that);
        Carousel.prototype.mover.call(that);
        that.nextBtn && Carousel.prototype.nextBtn.call(that);
        that.prevBtn && Carousel.prototype.prevBtn.call(that);
    }
    /*提词*/
    function trimStr(str) {
        if (str == null) return "";
        else return str.replace(/(^\s*)|(\s*$)/g, "");
    }
    function tici(input, box, URL) {
        var val = input.val();
        var timmer;
        input.off('focus').on('focus', function () {

            timmer = setInterval(function () {
                if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
                    input.focus();
                };
                if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE8.0") {
                    input.focus();
                };

                if (input.val() == "") { box.html("") };

                if (input.val() != val && trimStr(input.val()) != "") {
                    val = input.val();
                    $.ajax({
                        url:URL,
                        type:'get',
                        data:'inputbox='+val+'&num=8',
                        dataType:'jsonp',
                        jsonp:'callback',
                        jsonpCallback:"callback8219",
                        success:function(data){
                            box.show();
                            var c="";
                            var arr = eval('('+JSON.stringify(data)+')');
                            $.each(arr, function (i, item) {
                                var type = $(".input-btn-result").attr('data-id');
                                var u = "window.open('http://campus.chinahr.com/sou/?keyword="+this.k+"&jobtype="+type+"','_blank')"	;
                                c += '<li onclick="'+u+'">' + this.k.replace(input.val(), "<font color=#FF0000 >" + input.val() + "</font>") + '</li>';
                            });
                            box.html("<ul>" + c + "</ul>");
                        },
                        error: function(data){
                            // console.log(1)
                        }
                    })
                    //避免重复请求
                    val = input.val();
                }
                if (trimStr(box.html()) == "") {
                    box.hide();
                }

            })
            nc.screenFrame.tipWorf({
                'showBox': input,
                'tipBox': box
            });
        });

        input.on('blur', function () {
            input.val('');
            clearInterval(timmer);
        });

        input.off('click').on('click', function (e) {
            var e = e || event;
            if (e && e.stopPropagation()) {
                e.stopPropagation();
            } else {
                e.cancelBubble = true;
            }
        });
    }
    var main={
        init:function(){
            main.changeBar();
            main.switchProperty();
            main.enterSearch();
            main.lazyload();
        },
        lazyload : function(){
            var imgObj = $(".company .wrap img , .hotCompany .hot-wrap .all-hot img , .bounty .job-wrap .job img ");
            //监听当前可视区域的高度 显示图片
            for( var i=0; i<imgObj.length; i++){
                var objTop = imgObj.eq(i).offset().top;
                var height = $(window).height();
                var scrollTop = $(window).scrollTop();
                if( objTop <= height + scrollTop ){
                    if(!imgObj.eq(i).attr("src")){
                        var src = imgObj.eq(i).attr("data-original");
                        imgObj.eq(i).attr("src",src).show();
                    }
                }
            }
            //监听滚动事件 懒加载
            main.lazy( imgObj , 100);
            imgObj.each(function(){
                $(this).show();
            })

        },
        changeBar : function(){
            var list = $(".search-nav-index li");
            $.each( list , function(index){
                $(this).unbind("mouseover").bind("mouseover",function(){
                    $.each( list , function(){
                        $(this).css({"color":"black","border-bottom":"none"})
                    });
                    $(this).css({"color":"#19c967","border-bottom":"1px solid #19c967"})
                    var ul = $(".kind");
                    $.each( ul , function(){
                        $(this).css("display","none");
                    });
                    $(".company .kind").eq(index).css("display","block");
                });
            });
        },
        /*切换找实习 招全职按钮*/
        switchProperty:function(){
            $(".search-btn-wrap").unbind('mouseover').bind('mouseover' , function(){
                $(".input-property-btn").css("display" , "block");
                $(".input-btn-result").css("background","url('http://image.chinahr.com/campus/project/qihang.chinahr.com/img-pc/arrowup.png') 94px center no-repeat");
            });
            $(".input-property-btn a").unbind("click").bind("click" , function(){
                $(".input-property-btn").css("display" , "none");
                $(".input-btn-result").html($(this).html());
                $(".input-btn-result").attr('data-id',$(this).attr('data-id'));
                $('input[name=indexSearch]').val('');
            });
            $(".search-btn-wrap").unbind("mouseout").bind("mouseout",function(){
                $(".input-property-btn").hide();
                $(".input-btn-result").css("background","url('http://image.chinahr.com/campus/project/qihang.chinahr.com/img-pc/arrowdown.png') 94px center no-repeat");
            })
        },

        /*回车搜索*/
        enterSearch : function(){
            $("#searchInput").unbind("keydown").bind('keydown' , function(event){
                var e = event || window.event;
                if(e.keyCode==13){
                    if($('input[name=indexSearch]').val()==''){
                        window.open('http://campus.chinahr.com/sou/');
                    }else{
                        var jobtype = $('.search .input-btn-result').attr('data-id');
                        window.open('http://campus.chinahr.com/sou/?keyword='+$('input[name=indexSearch]').val()+'&jobtype='+jobtype+'','_blank');
                    }
                }
            })
        },
        /*lazyload*/
        lazy : function(imgObj  , value ){
            var l = 0;//记录当前遍历的对象位置
            var objTop = null;//当前对象的顶端偏移距离
            var height = null;//当前浏览器的可视窗口高度
            var scrollTop = null;//浏览器可视窗口网页被卷去的高度
            //监听滚动事件，动态懒加载
            $(window).unbind("scroll").bind("scroll" , function(event){
                for( var i=l; i<imgObj.length; i++){
                    objTop = imgObj.eq(i).offset().top;
                    height = $(window).height();
                    scrollTop = $(window).scrollTop();
                    var dis =  height + scrollTop - objTop;
                    if(dis + value >= 0){
                        if(!imgObj.eq(i).attr("src")){
                            var src = imgObj.eq(i).attr("data-original");
                            imgObj.eq(i).attr("src",src).show();
                        }
                    }
                    if(dis < 0){
                        l = i;
                        break;
                    }
                }
            });
        }
    }
    //定义广告相关信息
    var adsObj = [
        {
            companyName:"中国联通",
            jobName:"2017校招技术类岗位",
            workPlace:"河南",
            education:"本科",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/144210.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-liantong.jpg"
        },{
            companyName:"喜马拉雅FM",
            jobName:"产品专员（网申职位）",
            workPlace:"成都",
            education:"不限",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/139523.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-fm.jpg"
        },{
            companyName:"广州银行股份有限公司",
            jobName:"银行业务岗位",
            workPlace:"广州",
            education:"本科",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/143454.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-gzyinhang.jpg"
        },{
            companyName:"汉高中国",
            jobName:"2017校招采购部职位",
            workPlace:"上海",
            education:"本科",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/139497.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-hangao.jpg"
        },{
            companyName:"大连博融控股集团有限公司",
            jobName:"管培生-理工科方向",
            workPlace:"大连",
            education:"本科",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/138821.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-borong.jpg"
        },{
            companyName:"滴滴出行",
            jobName:"政府事务助理研究员",
            workPlace:"北京",
            education:"本科",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/139370.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-didi.jpg"
        },{
            companyName:"58集团",
            jobName:"新媒体运营专员",
            workPlace:"北京",
            education:"本科",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/135050.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-58.jpg"
        },{
            companyName:"咪咕文化科技有限公司",
            jobName:"二次元内容运营",
            workPlace:"成都",
            education:"本科",
            jobType:"全职",
            jobLink:"http://campus.chinahr.com/job/138160.html",
            companyLogo: obj.getImgPrefix()+"campus/project/qihang.chinahr.com/img-pc/company/logo-migu.jpg"
        }
    ];
    //加载广告内容列表
    function initAdsList(){
        var listStr = "";
        for(var i=0,len=adsObj.length;i<len;i++){
            var objData = adsObj[i];
            listStr += '<li class="job-list">';
            listStr += '<a href="'+objData.jobLink+'" target="_blank">'+objData.jobName+'</a>';
            listStr += '<p>'+objData.companyName+'</p><ul class="job-detail">';
            listStr += '<li class="bounty-logo"><img data-original="'+obj.getImgPrefix()+'campus/project/qihang.chinahr.com/img-pc/education.png"></li>';
            listStr += '<li>'+objData.education+'</li>';
            listStr += '<li class="bounty-logo"><img data-original="'+obj.getImgPrefix()+'campus/project/qihang.chinahr.com/img-pc/address.png"></li>';
            listStr += '<li>'+objData.workPlace+'</li>';
            listStr += '<li class="bounty-logo"><img data-original="'+obj.getImgPrefix()+'campus/project/qihang.chinahr.com/img-pc/jobproperty.png"></li>';
            listStr += '<li>'+objData.jobType+'</li></ul>';
            listStr += '<img class="bounty-company" data-original="'+objData.companyLogo+'"></li>';
        }
        if(listStr)
            $("#jobList").append(listStr);
    }
    $(function(){
        obj.initBanner(obj.list[0].url);
        obj.initGoodCompany(obj.list[1].url);
        obj.initHotCompany(obj.list[2].url);
        obj.initOffer(obj.list[3].url);
        nc.showNav({
            a:$('.backTop .erw'),
            b:$('.backTop .erwm'),
            fnS:function(){
                $('.backTop .back').addClass('hui');
            },
            fnH:function(){
                $('.backTop .back').removeClass('hui');
            }
        });
        $('.backTop .back').off('click').on('click',function(){
            $(window).scrollTop(0);
        });
        $('.search .search-btn').off('click').on('click',function(){
            var jobtype = $('.search .input-btn-result').attr('data-id');
            window.open('http://campus.chinahr.com/sou/?keyword='+$('input[name=indexSearch]').val()+'&jobtype='+jobtype+'','_blank')
        });
        tici($('input[name=indexSearch]'), $('.tipBox[data-id=indexSearch]'), 'http://suggest.chinahr.com/searchsuggest_yingcaijob.do');
        nc.screenFrame.input($('.input'));
        main.init();
        initAdsList()
    })
});
